<template>
 
</template>

<script>
export default {
  name: "modigForm",
  data() {
  


    var validatePass = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请输入密码"));
      } else {
        if (this.ruleForm.checkPass !== "") {
          this.$refs.ruleForm.validateField("checkPass");
        }
        callback();
      }
    };
    var validatePass2 = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请再次输入密码"));
      } else if (value !== this.ruleForm.pass) {
        callback(new Error("两次输入密码不一致!"));
      } else {
        callback();
      }
    };
    return {
        block : true,
      ruleForm: {
        pass: "",
        checkPass: "",
        
      },
      rules: {
        pass: [{ validator: validatePass, trigger: "blur" }],
        checkPass: [{ validator: validatePass2, trigger: "blur" }],
      
      }
    };
  },
  methods: {

      none(){
          this.block = false
      },

    submitForm(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
          alert("修改完成");
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    }
  }
};
</script>

<style lang="scss" >
.modeif_form{
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    
    background: rgba($color: #000000, $alpha: 0.3);
    position: fixed;
    z-index: 120;
    .form{
        padding: 44px;
        margin: 0 auto;
        width: 394px;
        background: #ffffff;
        border-radius:14px;
        margin-top:120px ; 
     .back-out{
         line-height: 42px;
        .el-icon-close{
            font-size:18px;
            color: #c8c8c8; 
            margin-right:10px; 
        }
        span{
            color: #414141;
            font-size: 18px
        }
     
     }
        .Tips{
            color: #2e86ff;
            font-size: 14px;
            margin-bottom:44px; 
        }
    .el-button {
        width: 100%;
        margin: 68px 0;

    }    
    }

}
</style>